<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-once </title>
    <script src="/js/vue-2.7.9-dev.js"></script>
    <style>
    </style>
    
</head>
<body>
    <div id="app">
        <h2 v-once>初始化的n值是: {{n}}</h2>
        <h2>当前的n值是: {{n}}</h2>
        <button @click="n++">点我n+1</button>
    </div>

    <script>
        let vm = new Vue({
            data() { 
                console.log("==", this);
                return { 
                    n:1
                }
            },
        })
        vm.$mount("#app")
        console.log("--",vm);
    </script>
</body>
</html>